package com.wl.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wl.dao.Buyerapprove_04Mapper;
import com.wl.entity.Buyerapprove_04;
import com.wl.service.BuyerApprove_04Service;
import com.wl.util.PageData;

@Service
public class BuyerApprove_04ServiceImpl implements BuyerApprove_04Service {
	@Autowired
	private Buyerapprove_04Mapper bam;
	@Autowired
	private PageData<Buyerapprove_04> pd;

	@Override
	public int deleteByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return bam.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(Buyerapprove_04 record) {
		// TODO Auto-generated method stub
		return bam.insert(record);
	}

	@Override
	public int insertSelective(Buyerapprove_04 record) {
		// TODO Auto-generated method stub
		return bam.insertSelective(record);
	}

	@Override
	public Buyerapprove_04 selectByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return bam.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(Buyerapprove_04 record) {
		// TODO Auto-generated method stub
		return bam.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Buyerapprove_04 record) {
		// TODO Auto-generated method stub
		return bam.updateByPrimaryKey(record);
	}

	@Override
	public List<Buyerapprove_04> listBuyerapprove_04sByKeywords(String keywords) {
		// TODO Auto-generated method stub
		return bam.listBuyerapprove_04sByKeywords(keywords);
	}

	@Override
	public PageData<Buyerapprove_04> listBuyerapprove_04sByPage(String keywords, Integer page, Integer pageSize) {
		// TODO Auto-generated method stub
		List<Buyerapprove_04> list1 = bam.listBuyerapprove_04sByKeywords(keywords);
		if (page < 1) {
			page = 1;
		}
		Integer start = (page - 1) * pageSize;
		List<Buyerapprove_04> list2 = bam.listBuyerapprove_04sByPage(keywords, start, pageSize);
		pd.setCode(0);
		pd.setCount(list1.size());
		pd.setData(list2);
		pd.setLimit(pageSize);
		pd.setMsg("");
		pd.setPage(page);
		return pd;
	}

	@Override
	public PageData<Buyerapprove_04> listBuyerApprove_04_waitByPage(String keywords, Integer page, Integer pageSize) {
		// TODO Auto-generated method stub
		List<Buyerapprove_04> list1 = bam.listBuyerApprove_04_wait(keywords);
		if (page < 1) {
			page = 1;
		}
		Integer start = (page - 1) * pageSize;
		List<Buyerapprove_04> list2 = bam.listBuyerApprove_04_waitByPage(keywords, start, pageSize);
		pd.setCode(0);
		pd.setCount(list1.size());
		pd.setData(list2);
		pd.setLimit(pageSize);
		pd.setMsg("");
		pd.setPage(page);
		return pd;
	}

	@Override
	public PageData<Buyerapprove_04> listBuyerApprove_04_approvedByPage(String keywords, Integer page,
			Integer pageSize) {
		// TODO Auto-generated method stub
		List<Buyerapprove_04> list1 = bam.listBuyerApprove_04_approved(keywords);
		if (page < 1) {
			page = 1;
		}
		Integer start = (page - 1) * pageSize;
		List<Buyerapprove_04> list2 = bam.listBuyerApprove_04_approvedByPage(keywords, start, pageSize);
		pd.setCode(0);
		pd.setCount(list1.size());
		pd.setData(list2);
		pd.setLimit(pageSize);
		pd.setMsg("");
		pd.setPage(page);
		return pd;
	}

	@Override
	public List<Buyerapprove_04> listBuyerApprove_04_wait(String keywords) {
		// TODO Auto-generated method stub
		return bam.listBuyerApprove_04_wait(keywords);
	}

	@Override
	public List<Buyerapprove_04> listBuyerApprove_04_approved(String keywords) {
		// TODO Auto-generated method stub
		return bam.listBuyerApprove_04_approved(keywords);
	}

}
